///////////////////////////////modify by vtwo
#ifndef _FPU_CONSTANTS_H_
#define _FPU_CONSTANTS_H_

#include <config.h>

// Pentium CPU uses only 68-bit precision M_PI approximation
// #define BETTER_THAN_PENTIUM

/*============================================================================
 * Written for Bochs (x86 achitecture simulator) by
 *            Stanislav Shwartsman (stl at fidonet.org.il)
 * ==========================================================================*/ 

//////////////////////////////
// PI, PI/2, PI/4 constants
//////////////////////////////

#define FLOATX80_PI_EXP  (0x4000)

// 128-bit PI fraction
#ifdef BETTER_THAN_PENTIUM
#define FLOAT_PI_HI (IA32_CONST64(0xc90fdaa22168c234LL))
#define FLOAT_PI_LO (IA32_CONST64(0xc4c6628b80dc1cd1LL))
#else
#define FLOAT_PI_HI (IA32_CONST64(0xc90fdaa22168c234LL))
#define FLOAT_PI_LO (IA32_CONST64(0xC000000000000000LL))
#endif

#define FLOATX80_PI2_EXP  (0x3FFF)
#define FLOATX80_PI4_EXP  (0x3FFE)

//////////////////////////////
// 3PI/4 constant
//////////////////////////////

#define FLOATX80_3PI4_EXP (0x4000)

// 128-bit 3PI/4 fraction
#ifdef BETTER_THAN_PENTIUM
#define FLOAT_3PI4_HI (IA32_CONST64(0x96cbe3f9990e91a7LL))
#define FLOAT_3PI4_LO (IA32_CONST64(0x9394c9e8a0a5159cLL))
#else
#define FLOAT_3PI4_HI (IA32_CONST64(0x96cbe3f9990e91a7LL))
#define FLOAT_3PI4_LO (IA32_CONST64(0x9000000000000000LL))
#endif

//////////////////////////////
// 1/LN2 constant
//////////////////////////////

#define FLOAT_LN2INV_EXP  (0x3FFF)

// 128-bit 1/LN2 fraction
#ifdef BETTER_THAN_PENTIUM
#define FLOAT_LN2INV_HI (IA32_CONST64(0xb8aa3b295c17f0bbLL))
#define FLOAT_LN2INV_LO (IA32_CONST64(0xbe87fed0691d3e89LL))
#else
#define FLOAT_LN2INV_HI (IA32_CONST64(0xb8aa3b295c17f0bbLL))
#define FLOAT_LN2INV_LO (IA32_CONST64(0xC000000000000000LL))
#endif

#endif
